 <#include "/admin/common/include/html_head.html"> <#include
"/admin/common/include/sysparam.html">

<style>
#editable {
	padding: 10px;
	float: left;
}
</style>

<div class="row-fluid">
	<div class="span12">
		<!-- BEGIN EXTRAS PORTLET-->
		<div class="portlet box">
			<div class="portlet-title">
				<div class="caption">
					<h5>模板页面编辑</h5>
				</div>
			</div>
			<div class="portlet-body form">
				<div class="alert alert-error " id="errtip" style="display: none;"></div>
				<!-- BEGIN FORM-->
				<form action="${contextPath}/template/save.op" id="templateAddForm"
					class="form-horizontal" method="post" onSubmit="return false;">
					<input type="hidden" name="id" value="${(bean.id)?if_exists}" /> 

					<div class="control-group">
						<label class="control-label">主题</label>
						<div class="controls">  
							<@select paramCode=templatePackageCode
							value=(bean.templatePackageId)?if_exists item=' require="true" name="templatePackageId"
							datatype="require" msg="主题不能为空"'/>
							</div>
					</div>

					<div class="control-group">
						<label class="control-label">模板名称</label>
						<div class="controls">
							<input class="span4 m-wrap" name="name" require="true"
								datatype="require|limit" type="text" min="1" max="100"
								msg="模板名称不能为空" value="${(bean.name)?if_exists}" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">模板路径</label>
						<div class="controls">
							<input class="span4 m-wrap" name="templatePath" require="true"
								datatype="require|limit" type="text" min="1" max="200"
								msg="模板路径不能为空" value="${(bean.templatePath)?if_exists}" />
						</div>
					</div> 
					<div class="control-group">
						<label class="control-label">模板类型</label>
						<div class="controls"><@select paramCode=templateTypeCode
							value=(bean.templateType)?if_exists item=' require="true" name="templateType"
							datatype="require" msg="模板类型不能为空"'/></div>
					</div>
					<div class="control-group">
						<label class="control-label">模板关联key</label>
						<div class="controls">

							<textarea class="span12  m-wrap" rows="5" id="groupKeys"
								name="groupKeys" require="true" datatype="require|limit"
								type="text" min="1" max="500" msg="模板路径不能为空">${(bean.groupKeys)?if_exists}</textarea>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">是否有效</label>
						<div class="controls"><@select2 paramCode=iseffCode
							value=(bean.iseff)?if_exists item=' require="true" name="iseff"
							datatype="require" msg="是否有效不能为空"'/></div>
					</div>
					<div class="form-actions">
						<button type="button" id="template_save_btn" class="btn blue">保存</button>
						<button type="button" id="template_return_btn" class="btn ">返回</button>

					</div>
				</form>
				<!-- END FORM-->
			</div>
		</div>
		<!-- END EXTRAS PORTLET-->
	</div>
</div>

<script>
	$(document).ready(function() {
		tableAction.initSaveAction({
			formId : 'templateAddForm',
			queryUrl : '${contextPath}/template/show.op',
			saveUrl : '${contextPath}/template/save.op',
			saveBtnId : 'template_save_btn'
		});

		$("#template_return_btn").bind("click", function() {
			var url = '${contextPath}/template/show.op';
			mainFrame.addContainer(url);
		});
	});
</script>
<#include "/admin/common/include/html_bottom.html">
